Tweak for building on Mac.
Things are a bit of a mess but at least it works again.