Add support to the build system for building header-only modulesi

These changes was originally made in opm-material, which is a header-only module that doesn't generate any library. They are added here to synchronize the build system across modules. They should not affect building opm-core.