diff --git a/Makefile b/Makefile
index 0c807e5cdf2630dce7121a0d0da25d2558281c58..3e31a5c2a60e4f3ab5f189491edfbe8335e960a2 100644
--- a/Makefile
+++ b/Makefile
@@ -9,14 +9,14 @@ BIBFILES = $(addsuffix /references.bib, ${CHAPTERDIRS})
 
 SAGESCRIPT = main.sagetex.sage
 
-main.pdf: ${TEXFILES} ${BIBFILES} ${PREAMBLEFILES} main.sagetex.sout.tmp tilt.rs
+main.pdf: ${TEXFILES} ${BIBFILES} ${PREAMBLEFILES} main.sagetex.sout.tmp tilt.rs notebook_tex
 	latexmk || echo this fails but seems to produce pdf correctly
 
 main.sagetex.sout.tmp: ${SAGESCRIPT} chapter_py_libs
 	PYTHONPATH=`echo $(CHAPTERDIRS) | sed 's/ \+/:/g'` sage ${SAGESCRIPT}
 
 ${SAGESCRIPT}: ${TEXFILES}
-	latexmk || echo this is meant to fail
+	latexmk \$max_repeat=<1> || echo this is meant to fail
 	# seems to be a bug with sagetex, only works if patched:
 	sed -i -e 's;version_check=)$$;version_check=True);' $@