Synchronise build system with opm-core

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