I ran into this problem when I was trying to install memcache on MAMP Pro running PHP 5.4.10 on OSX 10.8.
I resolved the problem by using the phpize located within the PHP version within MAMP so for example when compiling I used /Applications/MAMP/bin/php/php5.4.10/bin/phpize
with my PHP version being 5.4.10
I suggest phpize'ing it with /Applications/MAMP/bin/php/php5.x.x/bin/phpize
instead of the phpize located in the /usr/local/bin/
Also worth mentioning I ran into a few problems with the compiler so found a useful post HERE which explains to use MACOSX_DEPLOYMENT_TARGET=10.8 CFLAGS='-fgnu89-inline' LDFLAGS='-fgnu89-inline' CXXFLAGS='-fgnu89-inline' ./configure
instead of the ordinary ./configure