I see that this bug is fallout from trying to fix #817884, which was also reported as #817988 where it was noted that "Dynamic linking uses the _abiname_, which is libm.so.6 in this case, but is may be libm.so.6.1 or libm.so.0.3 in other cases." I note that the patch applied to mpi4py in #817884 ignored that last clause therefore broke the build on arches that do not have libm.so.6 as the abiname.
Cheers Michael.