diff --git a/tools/configure/Makefile.mingw b/tools/configure/Makefile.mingw
index 539664e7d6e86d2dd9b730de45206ab3dbb98ad1..f4513c64d6e26ea3f32b4915372982d8f3640408 100644
--- a/tools/configure/Makefile.mingw
+++ b/tools/configure/Makefile.mingw
@@ -89,7 +89,7 @@ $(OBJECTS): $(PCH)
 # sh-compatible shell. This is not a problem, because configure.bat
 # will not do that.
 ifeq ($(SHELL), sh.exe)
-    ifeq ($(wildcard $(CURDIR)/sh.exe), )
+    ifeq ($(wildcard "$(CURDIR)/sh.exe"), )
         SH = 0
     else
         SH = 1