--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -73,10 +73,10 @@
 	$(MKOCTFILE) $(CPPFLAGS) -c save.cc $(LDFLAGS) -o $@ -I.
 
 mkfunction:
-	 mkdir @function
+	 mkdir -p @function
 
 mkmesh:
-	 mkdir @mesh
+	 mkdir -p @mesh
 
 plot_mesh.oct: plot_mesh.o mkmesh
 	$(MKOCTFILE) $(CPPFLAGS) plot_mesh.o -o ./@mesh/plot.oct $(LDFLAGS) $(LIBS)