--- a/sql/Makefile
+++ b/sql/Makefile
@@ -29,7 +29,8 @@
 top_builddir = ..
 
 ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
+PG_CONFIG = pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
 subdir = contrib
--- a/sql/pgpool-recovery/Makefile
+++ b/sql/pgpool-recovery/Makefile
@@ -14,7 +14,8 @@
 top_builddir = ../..
 
 ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
+PG_CONFIG = pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
 subdir = contrib/pgpool-recovery
--- a/sql/pgpool-regclass/Makefile
+++ b/sql/pgpool-regclass/Makefile
@@ -14,7 +14,8 @@
 top_builddir = ../..
 
 ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
+PG_CONFIG = pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
 subdir = contrib/pgpool-regclass
