THRIFT-4717: fix up make clean with autoconf
diff --git a/lib/php/Makefile.am b/lib/php/Makefile.am
index 8d9050a..7fdebe1 100755
--- a/lib/php/Makefile.am
+++ b/lib/php/Makefile.am
@@ -33,6 +33,7 @@
 phpmodule_SCRIPTS = src/ext/thrift_protocol/modules/thrift_protocol.so
 
 distclean-local:
+	if [ -f src/ext/thrift_protocol/Makefile ]; then cd src/ext/thrift_protocol/ && $(MAKE) distclean; fi
 	cd $(phpmodule_SCRIPTS) && $(PHPIZE) --clean
 
 endif
@@ -128,6 +129,10 @@
   lib/Type/TType.php \
   lib/Type/TConstant.php
 
+clean-local:
+	if [ -f src/ext/thrift_protocol/Makefile ]; then cd src/ext/thrift_protocol/ && $(MAKE) clean; fi
+
+
 EXTRA_DIST = \
   lib \
   src/autoload.php \
@@ -144,6 +149,5 @@
   README.md
 
 MAINTAINERCLEANFILES = \
-  Makefile \
   Makefile.in