diff --git a/src/cluster/Makefile b/src/cluster/Makefile
index ad58bc12517f419ae76701dbc7bcea4328ec3d7c..d51380146e918e94b848a0a72c65b9d107eb5d85 100644
--- a/src/cluster/Makefile
+++ b/src/cluster/Makefile
@@ -1,21 +1,18 @@
 BUILDDIR=../../build/cluster
-FC=gfortran
-FCFLAGS=-std=legacy -O3
-LFLAGS=
-CXX=g++
-CXXFLAGS=-O3 -ggdb -pg -coverage
-CXXLFLAGS=-L/usr/lib64 -lhdf5_hl -lhdf5
+
+include ../make.inc
+
 
 all: clu edfb np_cluster
 
 clu: clu.o
-	$(FC) $(FCFLAGS) -o $(BUILDDIR)/clu $(BUILDDIR)/clu.o $(LFLAGS)
+	$(FC) $(FCFLAGS) -o $(BUILDDIR)/clu $(BUILDDIR)/clu.o $(LDFLAGS)
 
 edfb: edfb.o
-	$(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LFLAGS)
+	$(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LDFLAGS)
 
 np_cluster: $(BUILDDIR)/np_cluster.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/clu_subs.o $(BUILDDIR)/cluster.o
-	$(CXX) $(CXXFLAGS) $(CXXLFLAGS) -o $(BUILDDIR)/np_cluster $(BUILDDIR)/np_cluster.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/clu_subs.o $(BUILDDIR)/cluster.o
+	$(CXX) $(CXXFLAGS) -o $(BUILDDIR)/np_cluster $(BUILDDIR)/np_cluster.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/clu_subs.o $(BUILDDIR)/cluster.o $(CXXLDFLAGS) 
 
 $(BUILDDIR)/np_cluster.o:
 	$(CXX) $(CXXFLAGS) -c np_cluster.cpp -o $(BUILDDIR)/np_cluster.o
@@ -47,6 +44,3 @@ clean:
 wipe:
 	rm -f $(BUILDDIR)/clu $(BUILDDIR)/edfb $(BUILDDIR)/*.o
 
-%.o : %.f
-	$(FC) $(FCFLAGS) -c -o $(BUILDDIR)/$@ $<
-
diff --git a/src/sphere/Makefile b/src/sphere/Makefile
index a7e43dc195969963f872adcd2ba42ca06df19da8..79c2aae65593ccb722ae41297c0b1b49ad7e088e 100644
--- a/src/sphere/Makefile
+++ b/src/sphere/Makefile
@@ -1,21 +1,24 @@
 BUILDDIR=../../build/sphere
-FC=gfortran
-FCFLAGS=-std=legacy -O3
-LFLAGS=
-CXX=g++
-CXXFLAGS=-O2 -ggdb -pg -coverage
-CXXLFLAGS=-L/usr/lib64 -lhdf5_hl -lhdf5
+
+include ../make.inc
+
+#FC=gfortran
+#FCFLAGS=-std=legacy -O3
+#LFLAGS=
+#CXX=g++
+#CXXFLAGS=-O2 -ggdb -pg -coverage
+#CXXLFLAGS=-L/usr/lib64 -lhdf5_hl -lhdf5
 
 all: edfb sph np_sphere
 
 edfb: edfb.o
-	$(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LFLAGS)
+	$(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LDFLAGS)
 
 sph: sph.o
-	$(FC) $(FCFLAGS) -o $(BUILDDIR)/sph $(BUILDDIR)/sph.o $(LFLAGS)
+	$(FC) $(FCFLAGS) -o $(BUILDDIR)/sph $(BUILDDIR)/sph.o $(LDFLAGS)
 
 np_sphere: $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/sphere.o
-	$(CXX) $(CXXFLAGS) $(CXXLFLAGS) -o $(BUILDDIR)/np_sphere $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/sphere.o
+	$(CXX) $(CXXFLAGS) -o $(BUILDDIR)/np_sphere $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/sphere.o $(CXXLDFLAGS) 
 
 $(BUILDDIR)/np_sphere.o:
 	$(CXX) $(CXXFLAGS) -c np_sphere.cpp -o $(BUILDDIR)/np_sphere.o
@@ -44,6 +47,3 @@ clean:
 wipe:
 	rm -f $(BUILDDIR)/edfb $(BUILDDIR)/sph $(BUILDDIR)/*.o
 
-%.o : %.f
-	$(FC) $(FCFLAGS) -c -o $(BUILDDIR)/$@ $<
-
diff --git a/src/trapping/Makefile b/src/trapping/Makefile
index 6ef0230211db5f79c409207f64dc2e9f92e5c2ab..9c9ff9d438dcfafbb4bdcfc0de58bad75738e2e8 100644
--- a/src/trapping/Makefile
+++ b/src/trapping/Makefile
@@ -1,21 +1,24 @@
 BUILDDIR=../../build/trapping
-FC=gfortran
-FCFLAGS=-std=legacy -O3
-LFLAGS=
-CXX=g++
-CXXFLAGS=-O2 -ggdb -pg -coverage
-CXXLFLAGS=-L/usr/lib64 -lhdf5_hl -lhdf5
+
+include ../make.inc
+
+#FC=gfortran
+#FCFLAGS=-std=legacy -O3
+#LFLAGS=
+#CXX=g++
+#CXXFLAGS=-O2 -ggdb -pg -coverage
+#CXXLFLAGS=-L/usr/lib64 -lhdf5_hl -lhdf5
 
 all: frfme lffft np_trapping
 
 frfme: frfme.o
-	$(FC) $(FCFLAGS) -o $(BUILDDIR)/frfme $(BUILDDIR)/frfme.o $(LFLAGS)
+	$(FC) $(FCFLAGS) -o $(BUILDDIR)/frfme $(BUILDDIR)/frfme.o $(LDFLAGS)
 
 lffft: lffft.o
-	$(FC) $(FCFLAGS) -o $(BUILDDIR)/lffft $(BUILDDIR)/lffft.o $(LFLAGS)
+	$(FC) $(FCFLAGS) -o $(BUILDDIR)/lffft $(BUILDDIR)/lffft.o $(LDFLAGS)
 
 np_trapping: $(BUILDDIR)/np_trapping.o $(BUILDDIR)/cfrfme.o $(BUILDDIR)/clffft.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/tra_subs.o
-	$(CXX) $(CXXFLAGS) $(CXXLFLAGS) -o $(BUILDDIR)/np_trapping $(BUILDDIR)/np_trapping.o $(BUILDDIR)/cfrfme.o $(BUILDDIR)/clffft.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/tra_subs.o
+	$(CXX) $(CXXFLAGS) -o $(BUILDDIR)/np_trapping $(BUILDDIR)/np_trapping.o $(BUILDDIR)/cfrfme.o $(BUILDDIR)/clffft.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/tra_subs.o $(CXXLDFLAGS) 
 
 $(BUILDDIR)/np_trapping.o:
 	$(CXX) $(CXXFLAGS) np_trapping.cpp -c -o $(BUILDDIR)/np_trapping.o
@@ -50,6 +53,3 @@ clean:
 wipe:
 	rm -f $(BUILDDIR)/frfme $(BUILDDIR)/lffft $(BUILDDIR)/*.o
 
-%.o : %.f
-	$(FC) $(FCFLAGS) -c -o $(BUILDDIR)/$@ $<
-