diff --git a/src/bin/pgbench/Makefile b/src/bin/pgbench/Makefile
index e9b1b74abfaffba6d7ec35f9352d20167f8e6f63..560bfea6c4f0f14bd4e222f598d5a6b7820478c3 100644
--- a/src/bin/pgbench/Makefile
+++ b/src/bin/pgbench/Makefile
@@ -37,6 +37,7 @@ uninstall:
 
 clean distclean:
 	rm -f pgbench$(X) $(OBJS)
+	rm -rf tmp_check
 
 maintainer-clean: distclean
 	rm -f exprparse.c exprscan.c
diff --git a/src/test/ssl/Makefile b/src/test/ssl/Makefile
index 39fb3e948d74dd886424c1e81c1cb5ba1ff857be..d8c474196340c4bc38e2ddb8d0994a59319ef3c3 100644
--- a/src/test/ssl/Makefile
+++ b/src/test/ssl/Makefile
@@ -122,5 +122,8 @@ ssl/root+client.crl: ssl/root.crl ssl/client.crl
 sslfiles-clean:
 	rm -f $(SSLFILES) ssl/client_ca.srl ssl/server_ca.srl ssl/client_ca-certindex* ssl/server_ca-certindex* ssl/root_ca-certindex* ssl/root_ca.srl ssl/temp_ca.crt ssl/temp_ca_signed.crt
 
+clean distclean maintainer-clean:
+	rm -rf tmp_check
+
 check:
 	$(prove_check)