It is not clear to me why there are two tables, Sinergias and Singerias_Materias. If I understand it correctly, you want to have a many-to-many table for relations between plants.
So that would be
ALTER TABLE Sinergias ADD
CONSTRAINT fk_Sinergias_Materias1
FOREIGN KEY (uid_materia) REFERENECS Matierias (uid_Materia),
CONSTRAINT fk_Sinergias_Materias2
FOREIGN KEY (uid_synergia) REFERENECS Matierias (uid_Materia)
You cannot have a foreign key from the Materias table to the junction table. A foreign key serves to enforce that a reference exists.