diff --git a/src/Makefile b/src/Makefile
index 8e30f71de441b29d745ba944206be9cb71290550..eb1078181acfc8ad9f3f5c022b821e11e6eb3e0f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,16 +1,12 @@
 SUBDIRS := cluster sphere trapping
 SRCDIR=$(PWD)
 BUILDDIR=$(SRCDIR)/../build
-CC=g++
 
 all: $(SUBDIRS)
 
 $(SUBDIRS):
 	$(MAKE) -C $@
 
-np_sphere: $(BUILDDIR)/sphere/np_sphere.o $(BUILDDIR)/sphere/Commons.o $(BUILDDIR)/sphere/Configuration.o $(BUILDDIR)/sphere/Parsers.o $(BUILDDIR)/sphere/sphere.o
-	$(CC) -o $(BUILDDIR)/sphere/np_sphere $(BUILDDIR)/sphere/np_sphere.o $(BUILDDIR)/sphere/Commons.o $(BUILDDIR)/sphere/Configuration.o $(BUILDDIR)/sphere/Parsers.o $(BUILDDIR)/sphere/sphere.o
-
 clean:
 	rm -f $(BUILDDIR)/cluster/*.o
 	rm -f $(BUILDDIR)/sphere/*.o
@@ -22,18 +18,3 @@ wipe:
 	rm -f $(BUILDDIR)/trapping/*
 
 .PHONY: all $(SUBDIRS)
-
-$(BUILDDIR)/sphere/np_sphere.o:
-	$(CC) -c np_sphere.cpp -o $(BUILDDIR)/sphere/np_sphere.o
-
-$(BUILDDIR)/sphere/Commons.o:
-	$(CC) -c Commons.cpp -o $(BUILDDIR)/sphere/Commons.o
-
-$(BUILDDIR)/sphere/Configuration.o:
-	$(CC) -c Configuration.cpp -o $(BUILDDIR)/sphere/Configuration.o
-
-$(BUILDDIR)/sphere/Parsers.o:
-	$(CC) -c Parsers.cpp -o $(BUILDDIR)/sphere/Parsers.o
-
-$(BUILDDIR)/sphere/sphere.o:
-	$(CC) -c sphere/sphere.cpp -o $(BUILDDIR)/sphere/sphere.o
diff --git a/src/Commons.cpp b/src/libnptm/Commons.cpp
similarity index 98%
rename from src/Commons.cpp
rename to src/libnptm/Commons.cpp
index d5141e077a825428ee0bca173705f4a96caa1f0b..809337ea7adb2475af3d0325d3cbd1b139c025d6 100644
--- a/src/Commons.cpp
+++ b/src/libnptm/Commons.cpp
@@ -2,7 +2,7 @@
  *
  */
 
-#include "include/Commons.h"
+#include "../include/Commons.h"
 
 using namespace std;
 
diff --git a/src/Configuration.cpp b/src/libnptm/Configuration.cpp
similarity index 99%
rename from src/Configuration.cpp
rename to src/libnptm/Configuration.cpp
index 3765f44997b4c939716c87e20a2844160558226b..6bb02bddd092ed30b02aebf2ef88b0e3f524645a 100644
--- a/src/Configuration.cpp
+++ b/src/libnptm/Configuration.cpp
@@ -5,9 +5,9 @@
 #include <cstdio>
 #include <fstream>
 #include <string>
-#include "include/List.h"
-#include "include/Parsers.h"
-#include "include/Configuration.h"
+#include "../include/List.h"
+#include "../include/Parsers.h"
+#include "../include/Configuration.h"
 
 using namespace std;
 
diff --git a/src/Parsers.cpp b/src/libnptm/Parsers.cpp
similarity index 91%
rename from src/Parsers.cpp
rename to src/libnptm/Parsers.cpp
index 321c91df91c0b3c82f63de520d3c1d5631fa36de..a327df810c95b58e3c0e94cfe207f104d482a5bd 100644
--- a/src/Parsers.cpp
+++ b/src/libnptm/Parsers.cpp
@@ -3,8 +3,8 @@
 
 #include <fstream>
 #include <string>
-#include "include/List.h"
-#include "include/Parsers.h"
+#include "../include/List.h"
+#include "../include/Parsers.h"
 
 std::string *load_file(std::string file_name, int *count = 0) {
   std::fstream input_file(file_name.c_str(), std::ios::in);
diff --git a/src/sphere/Makefile b/src/sphere/Makefile
index 41d1d3342ed431507d63447b539fe3813fb2d827..c42d9b04f701cfb823a0c443581c96c23207d920 100644
--- a/src/sphere/Makefile
+++ b/src/sphere/Makefile
@@ -2,8 +2,11 @@ BUILDDIR=../../build/sphere
 FC=gfortran
 FCFLAGS=-std=legacy -O3
 LFLAGS=
+CXX=g++
+CXXFLAGS=-O0 -ggdb -pg -coverage
+CXXLFLAGS=
 
-all: edfb sph
+all: edfb sph np_sphere
 
 edfb: edfb.o
 	$(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LFLAGS)
@@ -11,6 +14,24 @@ edfb: edfb.o
 sph: sph.o
 	$(FC) $(FCFLAGS) -o $(BUILDDIR)/sph $(BUILDDIR)/sph.o $(LFLAGS)
 
+np_sphere: $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sphere.o
+	$(CXX) $(CXXFLAGS) $(CXXLFLAGS) -o $(BUILDDIR)/np_sphere $(BUILDDIR)/np_sphere.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sphere.o
+
+$(BUILDDIR)/np_sphere.o:
+	$(CXX) $(CXXFLAGS) -c ../np_sphere.cpp -o $(BUILDDIR)/np_sphere.o
+
+$(BUILDDIR)/Commons.o:
+	$(CXX) $(CXXFLAGS) -c ../libnptm/Commons.cpp -o $(BUILDDIR)/Commons.o
+
+$(BUILDDIR)/Configuration.o:
+	$(CXX) $(CXXFLAGS) -c ../libnptm/Configuration.cpp -o $(BUILDDIR)/Configuration.o
+
+$(BUILDDIR)/Parsers.o:
+	$(CXX) $(CXXFLAGS) -c ../libnptm/Parsers.cpp -o $(BUILDDIR)/Parsers.o
+
+$(BUILDDIR)/sphere.o:
+	$(CXX) $(CXXFLAGS) -c sphere.cpp -o $(BUILDDIR)/sphere.o
+
 clean:
 	rm -f $(BUILDDIR)/*.o