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

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