diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index d512a932a75d39bd465c66a5a50f88e997c4d709..c818c46f9eef0c04155200ffb858d353ed53e297 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -1,10 +1,12 @@
+CFLAGS = -I$(top_srcdir) @CFLAGS@ -O0
+CPPFLAGS = @CPPFLAGS@
 
 TS_PROGS = aes-test arcfour-test md5-test
 
 noinst_PROGRAMS = $(TS_PROGS)
 
 LDADD = testutils.o ../libnettle.a
-EXTRA_DIST = macros.h $(SOURCES:.c=.m4)
+EXTRA_DIST = $(SOURCES:.c=.m4) testutils.c testutils.h run-tests
 
 M4FLAGS = -P -s
 %.c: macros.m4 %.m4
@@ -16,5 +18,5 @@ M4FLAGS = -P -s
 check: run-tests
 
 run-tests: $(TS_PROGS)
-	./run-tests $^
+	$(srcdir)/run-tests $^