BF: refactor conditional compiling again

Add ability to use custom code for compiler flag checks, so we can check
for missing headers.
RF: add link flags option to optional compile

Allow optional compile to pass link flags separately from compile flags.
DOC: fix docstring for flag checking

Update docstring for new API.
Merge pull request #453 from matthew-brett/fix-conditional-compile

BF: refactor conditional compiling again