Yes you can compile it and add it to the php.ini or use dl('pgsql.so') in your code
The docs will show you how to compile a php extension and use it.
or if you have the source from the previuos compile rerun the ./configure appending --with-pgsql
run make && make install
restart apache...
if you get errors check /etc/ls.so.conf
make sure the postgresql libs are in one of the path statements