Follow http://developer.postgresql.org/pgdocs/postgres/docguide-toolsets.html with some corrections:
# Where is the binary for perl5 located on your system? PERL = /usr/bin/perl # Where do you want the sgmlspl executable script to be installed? BINDIR = /usr/bin # Where do you put local perl5 libaries? PERL5DIR = /usr/lib/perl5/site_perl
After that building of documentation went smoothly :)