--- a/src/Makefile
+++ b/src/Makefile
@@ -15,7 +15,7 @@
 
 AR := $(shell $(MKOCTFILE) -p AR)
 
-PKG_CXXFLAGS := -Wall -Wno-deprecated-declarations $(PKG_CXXFLAGS_APPEND)
+PKG_CXXFLAGS := $(CXXFLAGS) -Wall -Wno-deprecated-declarations $(PKG_CXXFLAGS_APPEND)
 
 all: __control_slicot_functions__.oct \
      __control_helper_functions__.oct
@@ -66,6 +66,7 @@
 
 # helper functions
 __control_helper_functions__.oct: __control_helper_functions__.cc
+	LDFLAGS="$(LDFLAGS)" \
 	$(MKOCTFILE) $(PKG_CXXFLAGS) __control_helper_functions__.cc
 
 clean:
