diff --git a/.gitignore b/.gitignore
index e0024388653b3d9f828bdb61e7f3635098e4e810..7f47b2f3b7655bd9b616f02dcbb66cf6c6cd92a4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@
 /configure
 /ganeti
 /stamp-directories
+/stamp-srclinks
 /*.patch
 /*.tar.bz2
 /*.tar.gz
diff --git a/Makefile.am b/Makefile.am
index 44413ad8e641c41fc074cb740faecced2cc9d8e1..99c3b1c0f5a6b5c0e7b138fd9ce7eda4235c7f0e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,11 +68,12 @@ CLEANFILES = \
 	qa/*.py[co] \
 	test/*.py[co] \
 	stamp-directories \
+	stamp-srclinks \
 	$(nodist_pkgpython_PYTHON)
 
 BUILT_SOURCES = \
 	ganeti \
-	srclinks \
+	stamp-srclinks \
 	stamp-directories \
 	lib/_autoconf.py
 
@@ -410,13 +411,14 @@ $(REPLACE_VARS_SED): Makefile
 
 # We need to create symlinks because "make distcheck" will not install Python
 # files when building.
-srclinks: stamp-directories
+stamp-srclinks: Makefile stamp-directories
 	set -e; \
 	for i in $(srclink_files); do \
 		if test ! -f $$i -a -f $(abs_top_srcdir)/$$i; then \
 			$(LN_S) $(abs_top_srcdir)/$$i $$i; \
 		fi; \
 	done
+	touch $@
 
 .PHONY: ganeti
 ganeti: