diff --git a/Makefile.am b/Makefile.am
index f799d617ebce96b2d0c96723cc39f220484b5568..93e1814de74a160db505e489d3bd4d67fbe720f8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -201,7 +201,7 @@ EXTRA_DIST = \
 	autotools/build-bash-completion \
 	autotools/check-python-code \
 	autotools/docbook-wrapper \
-	autotools/run-in-tempdir \
+	$(RUN_IN_TEMPDIR) \
 	daemons/ganeti-cleaner.in \
 	devel/upload.in \
 	$(docdot) \