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
BF: fix link to npy_math function

Link against numpy static math library - see
https://github.com/numpy/numpy/blob/master/doc/source/reference/c-api.coremath.rst
HACK: work round windows npymath compiling

Numpy binaries built with mingw have ``libnpymath.a`` library to link
against, but VC needs ``npymath.lib``.  The mingw library may be
compatible with VC, so detect the problem, and copy the library to a
temporary location to link against.