An OpenFTS  0.2 install is not finding the Postgresql headers on a FreeBSD OpenACS 4.6.1 install. I've tried the above suggestions without success.
I think the header files exist in their normal FreeBSD place:
$ ls /usr/ports/databases/postgresql7/work/postgresql-7.2.3/src/include
Makefile		mb			postgres.h
access			miscadmin.h		postgres_ext.h
bootstrap		nodes			postgres_fe.h
c.h			optimizer		regex
catalog			parser			rewrite
commands		pg_config.h		rusagestub.h
dynloader.h		pg_config.h.in		stamp-h
executor		pg_config.h.win32	storage
fmgr.h			pg_config_os.h		strdup.h
lib			pgstat.h		tcop
libpq			port			utils
$ 
I've modified the configure file per thread instructions.  Currently, I'm trying to configure with:
./configure \ 
--with-pgsql=/usr/ports/databases/postgresql7/work/postgresql-7.2.3 \
 --with-aolserver-src=/usr/ports/www/aolserver/work/aolserver-3.4
Any other suggestions?