Synchronise build system with opm-core

Bring in recent changes and build-system improvements from opm-core.

This resolves #59.