Merge pull request #10 from erikd/master

Two trivial patches
Updated package build configuration file to use github repository.
get the functional test work temparily, because one test is for fo.usa server, however it is not using the new code.
Remove trailing whitespace in Makefiles.
Build system cleanup and improvement.

* Split out PG_CFLAGS and GLIB_CFLAGS so they're only calculated once.
* Rename all CFLAGS_* variables to *_CFLAGS.
* Split compile and link into CFLAGS and LDFLAGS respectively.