diff --git a/lib/Makefile b/lib/Makefile
index 5a16cabc12bef5a6c8d0ccfc8b0812bfde26ed92..3ca1e03bb8159d6b02c4b3383ebeafa16585cbd7 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,19 +1,23 @@
+.PHONY: all
 all:
 	cd c ; make
 	cd csharp ; make
 	cd java ; make
 
+.PHONY: test
 test:
 	$(MAKE) -C c test
 
+.PHONY: clean
 clean:
-	cd c ; make clean
-	cd csharp ; make clean
-	cd java ; make clean
+	$(MAKE) -C c clean
+	$(MAKE) -C csharp clean
+	$(MAKE) -C java clean
 	$(MAKE) -C python clean
 
+.PHONY: distclean
 distclean:
-	cd c ; make distclean
-	cd csharp ; make clean
-	cd java ; make clean
-	$(MAKE) -C python clean
+	$(MAKE) -C c distclean
+	$(MAKE) -C csharp distclean
+	$(MAKE) -C java  distclean
+	$(MAKE) -C python distclean
diff --git a/lib/csharp/Makefile b/lib/csharp/Makefile
index 370c77e2fce1d12e48fa99ff3ce766feab2748b7..1a18f3b93c64c0d8db5ca055693e00bf10effcc5 100644
--- a/lib/csharp/Makefile
+++ b/lib/csharp/Makefile
@@ -16,4 +16,6 @@ labcomm.dll: $(MODULES:%=se/lth/control/labcomm/%.cs) Makefile
 	mcs -out:$@ -target:library $(filter %.cs, $^)
 
 clean:
+
+distclean:
 	rm -f labcomm.dll
diff --git a/lib/python/Makefile b/lib/python/Makefile
index 7798ea9c77f5297ce46b92db52dce08cb5022453..52022dde18e2646191216a34b6760601f405e724 100644
--- a/lib/python/Makefile
+++ b/lib/python/Makefile
@@ -1,5 +1,6 @@
+.PHONY: clean
 clean:
 	find . -name '*.pyc' -exec rm {} \;
 
-distclean:
-	find . -name '*.pyc' -exec rm {} \;
+.PHONY: distclean
+distclean: clean