The logic in m4/strtoimax.m4 is inverted: it replaces strtoimax() if and only if it is present and functional.
files/patch-m4_strtoimax.m4 should be submitted upstream by someone with a higher tolerance for GNU nonsense than me.
files/patch-configure avoids having to run autoreconf in the port and can be removed once the fix has been adopted upstream.