--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
@@ -47,6 +47,9 @@
 			PREFIX="$(prefix)" \
 			INC="$(AM_CPPFLAGS)"  \
 			CC="$(CC)"  \
+			LD="$(CC)" \
+			CCFLAGS="${CFLAGS}" \
+			OPTIMIZE="${CFLAGS}" \
 			OBJECT="hamlibperl_wrap.o" \
 			VERSION="$(PACKAGE_VERSION)" \
 			LIBS="-L$(top_builddir)/src/.libs -lhamlib"
