diff --git a/Makefile b/Makefile
index d5668f46d08478c9a9636cdac73a502d2ffb8f60..6bdaaf92c059ab3f8aee98e24bd10b18f4ed4169 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,9 @@ plugin:
 	$(MAKE) $(LIBD)/libplugin.so
 
 .PHONY: test
-test: $(TESTD)/test2
+test:
+	mkdir -p $(TESTD)
+	$(MAKE) $(TESTD)/test2
 
 $(TESTD)/%: $(TESTSRCD)/%.c
 	$(CC) $(TEST_FLAGS) $(PLUGIN_FLAGS) $^ -o $@