Synchronise build system with opm-core to restore debugging on MacOS X

This change-set brings in recent improvements to the build system from opm-core.  Most importantly, this restores the ability to debug software using host tools on MacOS X.