G'day Tom,
Thanks for the feedback. I couldn't find anywhere that suggested that I had set the CPPFLAGS or CFLAGS environment variables, so I removed the following lines from my profile:
#export USE_PGXS=1
#export PG_LIB_DIR="/usr/local/pgsql/lib"
#export PG_CONFIG="/usr/local/pgsql/bin/pg_config"
#export PGDATA="/usr/local/pgsql/data"
and tried again - worked a treat!
I haven't tried to work out which of these lines caused the problem, but hopefully if anyone else has a similar problem they might benefit!
cheers
Ben