Check for GNU ld

Some flags that are GNU ld-only are used.

Use OS X flags on OS X.