Set flags once per Makefile run

No need to run pkg-config from the command line of each compiler/linker
invokation.
Separate build and bin directories
Support both pre-1.2 and 1.2 platforms at the same time

Detect the platform version at runtime and select the pre-fillbuffer
method appropriately, rather than requiring a compile-time switch.