diff --git a/makefile b/makefile
index cb08be4838572ec5256db9c1dc8636bb95307582..a0ce518d4af28f9193398ab503652b77e113ae40 100644
--- a/makefile
+++ b/makefile
@@ -84,7 +84,7 @@ ifneq (0, $(CPPUNIT_EXISTS))
 $(error You need cppunit installed)
 endif
 
-READLINE_EXISTS = $(shell $(CXX) -o /dev/null -lcppunit -xc++ - <<< $$'\#include <readline/readline.h>\nint main() {\nreturn 0;\n}'; echo $$?)
+READLINE_EXISTS = $(shell $(CXX) -o /dev/null -lcppunit -xc++ - <<< $$'\#include <stdio.h>\n\#include <readline/readline.h>\nint main() {\nreturn 0;\n}'; echo $$?)
 ifneq (0, $(READLINE_EXISTS))
 $(error You need readline installed)
 endif