Fix builing under OS X.

Still isn't perfect, linker is unused for most builds, but at least it works.
IGNORE ME