As the he relevant fragment of the build log says: checking for PostgreSQL prerequisites... external PostgreSQL checking for pg_config... /usr/bin/pg_config checking for PostgreSQL C interface... checking libpq-fe.h usability... yes checking libpq-fe.h presence... yes checking for libpq-fe.h... yes checking for PQconnectdbParams in -lpq... no configure: error: libpq not found or too old. Need >= 9.0 However, there are both postgresql 8.4.9 and 9.1.1 installed on this particular box, so ebuild failed to pick the correct one.
Fixed in main tree, thanks for the report.