diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index cab2c7082904d52f53c9cf6def9ff6ab5ad34116..ce734117870a46e6b06843e9ac7b03017b7a0c1b 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -235,7 +235,6 @@ export ACLOCAL_AMFLAGS
 # Tools #
 #########
 
-PKG_CONFIG ?= pkg-config
 need_pkg = $(shell $(PKG_CONFIG) $(1) || echo 1)
 
 ifdef HAVE_CROSS_COMPILE
@@ -250,6 +249,8 @@ need_pkg = $(shell PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR) $(PKG_CONFIG) $(1) ||
 endif
 endif # HAVE_CROSS_COMPILE
 
+PKG_CONFIG ?= pkg-config
+
 PKG_CONFIG_PATH := $(PREFIX)/lib/pkgconfig:$(PKG_CONFIG_PATH)
 ifeq ($(findstring mingw32,$(BUILD)),mingw32)
 PKG_CONFIG_PATH := $(shell cygpath -pm ${PKG_CONFIG_PATH})