Synchronise build system with opm-core

Bring in recent improvements to the build system from opm-core.