diff --git a/configure.ac b/configure.ac
index 1682b81c4b68194ef731c5702c85cc751860979b..03bee7175116c1b3180bd3d6a2d8076c2cdbf2d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -786,7 +786,6 @@ if test "x$with_velociraptor" != "xno"; then
    if test "x$with_velociraptor" != "xyes" -a "x$with_velociraptor" != "x"; then
       VELOCIRAPTOR_LIBS="-L$with_velociraptor -lstf -lstdc++ -lhdf5_cpp"
       CFLAGS="$CFLAGS -fopenmp"
-      LIBS="$LIBS $VELOCIRAPTOR_LIBS"
    else
       VELOCIRAPTOR_LIBS=""
    fi
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 9b9f76294f6727ac174a34dc45d993c43708fd92..e4a12fc1a90c0f52c767efd378f4bea646c0d425 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -24,7 +24,7 @@ AM_CFLAGS = -I$(top_srcdir)/src $(HDF5_CPPFLAGS) $(GSL_INCS) $(FFTW_INCS)
 AM_LDFLAGS = $(HDF5_LDFLAGS)
 
 # Extra libraries.
-EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(GSL_LIBS)
+EXTRA_LIBS = $(HDF5_LIBS) $(FFTW_LIBS) $(PROFILER_LIBS) $(TCMALLOC_LIBS) $(JEMALLOC_LIBS) $(TBBMALLOC_LIBS) $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS) $(GSL_LIBS)
 
 # MPI libraries.
 MPI_LIBS = $(METIS_LIBS) $(MPI_THREAD_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 4ef050a096665c9f352f69636158aa5f284d50fe..2ae00837cd6709c0ac1dc7ca58e925fe64c2c7cd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -157,14 +157,14 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
 libswiftsim_la_SOURCES = $(AM_SOURCES)
 libswiftsim_la_CFLAGS = $(AM_CFLAGS)
 libswiftsim_la_LDFLAGS = $(AM_LDFLAGS) $(EXTRA_LIBS)
-libswiftsim_la_LIBADD = $(GRACKLE_LIBS)
+libswiftsim_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
 
 # Sources and flags for MPI library
 libswiftsim_mpi_la_SOURCES = $(AM_SOURCES)
 libswiftsim_mpi_la_CFLAGS = $(AM_CFLAGS) $(MPI_FLAGS)
 libswiftsim_mpi_la_LDFLAGS = $(AM_LDFLAGS) $(MPI_LIBS) $(EXTRA_LIBS)
 libswiftsim_mpi_la_SHORTNAME = mpi
-libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS)
+libswiftsim_mpi_la_LIBADD = $(GRACKLE_LIBS) $(VELOCIRAPTOR_LIBS)
 
 
 # Versioning. If any sources change then update the version_string.h file with