diff --git a/build/Makefile b/build/Makefile
index 646bec49641b66811595d87196490c6cebc5e091..fa61ee011a1579d2bcc575c52027c11dfa781138 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -84,7 +84,7 @@ $(PROG)-tiny.exe: $(TINY_SOURCES)
 	$(CL) $(TINY_SOURCES) /link $(LINK_FLAGS) res.res /out:$@
 
 $(PROG).dll: $(TINY_SOURCES) Makefile
-	$(CL) ../mongoose.c /GD /Gd /link $(LINK_FLAGS) /DLL /DEF:dll.def /out:$@
+	$(CL) ../mongoose.c /Gz /link $(LINK_FLAGS) /DLL /DEF:dll.def /out:$@
 
 # This is broken now due to SSL exclusion
 windows_unit_test.exe: $(LUA_SOURCES) Makefile