Study of the synthesis optimization of the magnetic superconductor RuSr2GdCu2O8