diff --git a/src/Makefile.am b/src/Makefile.am
index 089bc97..2d31b6a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -149,7 +149,7 @@ install-exec-hook:
 endif
 
 mkheader: mkheader.c Makefile
-	$(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
+	$(CC_FOR_BUILD) -I. -I$(srcdir) $(CFLAGS) -o $@ $(srcdir)/mkheader.c
 
 assuan.h: assuan.h.in mkheader $(parts_of_assuan_h)
 	./mkheader $(host_os) $(srcdir)/assuan.h.in \