Fix build failures with mips64el
The Debian package for v1.0 has been failing to build for mips64el. I managed to reproduce a chain of build errors in a chroot with qemu-user-binfmt and tried to fix whatever I could find. There is also one tiny patch that is already in Debian but apparently not forwarded upstream yet.