It's not clear at all how to divine the version of m4rie in a platform-independent way, once it is installed on a system, e.g. on Debian via
apt install libm4rie-dev.
This is desirable in view of e.g. https://trac.sagemath.org/ticket/27330
It’s very easy to add such support using autotools, as you might know.