I tried to fix NetBSD build without breaking FreeBSD, Linux and termux..
It seems I successed!
Attached patches builds (and runs)
on NetBSD 9.2 I386
FreeBSD 12.3 amd64
Slackware 15.0 i586
Termux aarch64
all without-thirdparty for saving build time.
Can you test them on your usual systems?