diff --git a/src/Makefile b/src/Makefile
index 5f63b2e5a9588ebdf2ab5a453a3f8bd53103a75d..7d41aea42e3556f5893eef45d10b496384cc7486 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -324,7 +324,7 @@ $(ECCODES_MOD) :
 	AEC_PATH=$(CDF_PATH) cmake ${DIR_ECCODES_SRC} -DCMAKE_INSTALL_PREFIX=${DIR_ECCODES_INSTALL} -DBUILD_SHARED_LIBS=OFF \
 	-DENABLE_NETCDF=OFF -DENABLE_JPG=OFF -DENABLE_PYTHON=OFF -DENABLE_EXAMPLES=OFF \
 	-DCMAKE_Fortran_COMPILER=$(FC) -DCMAKE_C_COMPILER=$(CC) \
-	-DCMAKE_Fortran_FLAGS=$(ECCODES_FFLAGS) -DCMAKE_C_FLAGS=$(ECCODES_CFLAGS) && \
+	-DCMAKE_Fortran_FLAGS=$(ECCODES_FFLAGS) -DCMAKE_C_FLAGS=$(ECCODES_CFLAGS) ${EC_CONF} && \
 	$(MAKE) && $(MAKE) install && $(MAKE) clean
 
 eccodes_lib_clean :