configure defines USE_UPNP = 0 in config.default when the library is not found, whereas the Makefile checks for the (non-)empty string.
(The same probably applies to the USE_FREETYPE check).
Fix:
diff --git a/Makefile b/Makefile
index cc53d6888..14f4a3ef7 100644
--- a/Makefile
+++ b/Makefile
@@ -114,7 +114,7 @@ ifdef MSG_LEVEL
CFLAGS += -DMSG_LEVEL=$(MSG_LEVEL)
endif
-ifneq ($(USE_UPNP),)
+ifneq ($(USE_UPNP),0)
CFLAGS += -DUSE_UPNP
ifeq ($(OSTYPE),mingw)
LDFLAGS += -Wl,-Bstatic -lminiupnpc -Wl,-Bdynamic -liphlpapi
Ok that needs to be changed.Thanks for spotting.