diff --git a/Makefile.am b/Makefile.am
index a82df97bee8c976ff058378438d6e21eba2ca2f7..a0d309572afa08b9d0a356c3d91f3f03af6aa274 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,4 +15,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # subdirectories
-SUBDIRS = src tests
+SUBDIRS = src
+
+if !HAVEPYTHON
+SUBDIRS += tests
+endif
diff --git a/src/Makefile.am b/src/Makefile.am
index 2ddb8dffb81996820868374ba1bb1c6a305a149e..289b6e62a96ee18ba9451706e102e11809a725b5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,7 +30,7 @@ GIT_CMD = @GIT_CMD@
 
 # Additional dependencies for shared libraries.
 EXTRA_LIBS = $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(HDF5_LIBS) $(FFTW_LIBS) $(GRACKLE_LIBS) \
-	$(VELOCIRAPTOR_LIBS) $(GSL_LIBS) -L../src/.libs -lswiftsim
+	$(VELOCIRAPTOR_LIBS) $(GSL_LIBS) -L../../src/.libs -lswiftsim
 
 # MPI libraries.
 # MPI_LIBS = $(MPI_THREAD_LIBS)
@@ -90,10 +90,11 @@ if HAVEPYTHON
 AM_SOURCES += logger_python_wrapper.c
 endif
 
+
 if HAVEPYTHON
 # The main python structure is dependent on the version, thus we need to
 # remove this one in order to be safe.
-PYTHON_EXTRA_COMPILER_FLAG = -Wno-missing-field-initializers -Wno-cast-function-type
+PYTHON_EXTRA_COMPILER_FLAG = -Wno-missing-field-initializers -Wno-cast-function-type -Wno-unused-function -Wno-unused-function
 endif
 
 # Include files for distribution, not installation.
@@ -109,10 +110,3 @@ nobase_noinst_HEADERS += star_formation/GEAR/logger_star_formation.h
 liblogger_la_SOURCES = $(AM_SOURCES)
 liblogger_la_CFLAGS = $(AM_CFLAGS) $(PYTHON_EXTRA_COMPILER_FLAG)
 liblogger_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS) $(BIN_LDFLAGS)
-
-# Sources and flags for MPI library
-# liblogger_mpi_la_SOURCES = $(AM_SOURCES)
-# liblogger_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS) $(PYTHON_EXTRA_COMPILER_FLAG)
-# liblogger_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)
-# liblogger_mpi_la_SHORTNAME = mpi
-# liblogger_mpi_la_LIBADD =
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 958a3b9fb89c1acbe12a3e92ba3cfcad9cca5c32..8c8eb4d70604ca79ace34fcd9304c459c780aadd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,9 +15,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Add the source directory and the non-standard paths to the included library headers to CFLAGS
-AM_CFLAGS = $(PYTHON_INCS) -I$(top_srcdir)/src -I$(top_srcdir)/logger $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
+AM_CFLAGS = $(PYTHON_INCS) -I$(top_srcdir)/src -I$(top_srcdir)/csds/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
 
-AM_LDFLAGS = ../../src/.libs/libswiftsim.a ../.libs/liblogger.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(FFTW_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS) $(PROFILER_LIBS) $(PYTHON_LIBS) -lswiftsim
+AM_LDFLAGS = ../src/.libs/liblogger.a $(HDF5_LDFLAGS) $(HDF5_LIBS) $(FFTW_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS) $(PROFILER_LIBS) $(PYTHON_LIBS) -L../../src/.libs -lswiftsim $(PYTHON_EXTRA_COMPILER_FLAG)
 
 # List of programs and scripts to run in the test suite
 TESTS = testLogfileHeader testLogfileReader testTimeArray testQuickSort testVirtualReality
@@ -26,7 +26,7 @@ TESTS = testLogfileHeader testLogfileReader testTimeArray testQuickSort testVirt
 check_PROGRAMS = testLogfileHeader testLogfileReader testTimeArray testQuickSort testVirtualReality
 
 # Rebuild tests when SWIFT is updated.
-$(check_PROGRAMS): ../../src/.libs/libswiftsim.a ../.libs/liblogger.a
+$(check_PROGRAMS): ../../src/.libs/libswiftsim.a ../src/.libs/liblogger.a
 
 # Sources for the individual programs
 testLogfileHeader_SOURCES = testLogfileHeader.c