diff --git a/Makefile b/Makefile
index 2e5906b0dd19ab3d97aba777cf4b2d0ad74721c4..7920bcd76e8d0d155f50b7fa6d8ac23bb4f50158 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,11 @@
 filename=main
 branch := $(shell git rev-parse --abbrev-ref HEAD)
 output: svg-inkscape main.pdf 
-	makeindex main.idx
-	makeglossaries main
-	pdflatex ${filename}.tex
 svg-inkscape:
 	pdflatex -shell-escape ${filename}.tex
 main.pdf:
+	makeindex main.idx
+	makeglossaries main
 	pdflatex ${filename}.tex
 resources:
 	pdflatex CS/resources.tex
@@ -16,4 +15,4 @@ tree:
 	git subtree -P config pull ../config ${branch}
 	git subtree -P config push ../config ${branch}
 clean:
-	$(RM) *.aux *.toc *.acn *.log *.ptc *.out *.idx *.ist *.glo *.glg *.gls *.acr *.alg *.ilg *.ind *.pdf
+	rm -fr *.aux *.toc *.acn *.log *.ptc *.out *.idx *.ist *.glo *.glg *.gls *.acr *.alg *.ilg *.ind *.pdf svg-inkscape