THRIFT-4717: fix up make clean with autoconf
diff --git a/test/php/Makefile.am b/test/php/Makefile.am
index 72f7fc5..5c42321 100755
--- a/test/php/Makefile.am
+++ b/test/php/Makefile.am
@@ -33,7 +33,12 @@
 check: stubs php_ext_dir
 
 clean-local:
-	$(RM) -r gen-php gen-phpi gen-php-classmap php_ext_dir
+	$(RM) -r gen-*/
+	$(RM) -r php_ext_dir
+
+dist-hook:
+	$(RM) -r $(distdir)/gen-*/
+	$(RM) -r $(distdir)/php_ext_dir/
 
 client: stubs php_ext_dir
 	php TestClient.php