Building brew install php55 --with-pgsql relies on postgresql the formula.
It requires that you have installed the postgresql formula with brew install postgresql, which is not the case for you (
Server.app)
which pg_config should outpout /usr/local/bin/pg_config
pg_config --includedir should outpout /usr/local/Cellar/postgresql/9.3.1/include
Install postgresql formula first, then you will be able to compile PHP 5.5 --with-pgsql
https://github.com/Homebrew/homebrew-php/issues/799