But really there are only two ways to deal with this.
1. make a better autoconf
2. avoid it as much as possible.
The first has been tried, many times and always found wanting.
The second - well, it's FreeBSDs fault using software 'ports' rather than prebuilt binaries. (Although I understand that you do that now)