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

This change-set brings in the most recent changes and improvements to the build system from opm-core.