diff --git a/Makefile b/Makefile
index 0dbd793d5925f3c13892cda7768860d0b93916d5..70dbcbb8fa564565579e9beee4fe724231358812 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,8 @@ format:
 
 # build a wheel package in dist folder
 build:
-	rm -r build/* dist/*
+	if [ -d "./build" ]; then rm -r build/*; fi
+	if [ -d "./dist" ]; then rm -r dist/*; fi
 	python setup.py sdist bdist_wheel
 
 # upload on PyPi repository