diff --git a/src/interfaces/libpq/Makefile b/src/interfaces/libpq/Makefile
index b5fd72a4ac..50aba04a4f 100644
--- a/src/interfaces/libpq/Makefile
+++ b/src/interfaces/libpq/Makefile
@@ -144,10 +144,18 @@ test-build:
 	$(MAKE) -C test all
 
 check: test-build all
+ifeq ($(enable_tap_tests),yes)
 	PATH="$(CURDIR)/test:$$PATH" && $(prove_check)
+else
+	$(prove_check)
+endif
 
 installcheck: test-build all
+ifeq ($(enable_tap_tests),yes)
 	PATH="$(CURDIR)/test:$$PATH" && $(prove_installcheck)
+else
+	$(prove_installcheck)
+endif
 
 installdirs: installdirs-lib
 	$(MKDIR_P) '$(DESTDIR)$(includedir)' '$(DESTDIR)$(includedir_internal)' '$(DESTDIR)$(datadir)'
