diff --git a/Makefile b/Makefile
index 23d161d0f6b432626329c9ffa52f94d2e31fab2a..c034046b3a0f40b2230c2410642331dbf27c821b 100644
--- a/Makefile
+++ b/Makefile
@@ -27,14 +27,19 @@ endif
 
 #OPT += -DNVIDIA
 # perform one-side communication (suggested) instead of reduce (only if MPI is active)
-OPT += -DONE_SIDE
+#OPT += -DONE_SIDE
 # write the full 3D cube of gridded visibilities and its FFT transform
 #OPT += -DWRITE_DATA
 # write the final image
 OPT += -DWRITE_IMAGE
 # perform w-stacking phase correction
-OPT += -DPHASE_ON
+#OPT += -DPHASE_ON
+# Support CFITSIO
+OPT += -DFITSIO
 
+ifeq (FITSIO,$(findstring FITSIO,$(OPT)))
+	LIBS += -L$(FITSIO_LIB) -lcfitsio
+endif
 
 DEPS = w-stacking.h w-stacking-fftw.c w-stacking.cu phase_correction.cu
 COBJ = w-stacking.o w-stacking-fftw.o phase_correction.o