Build system improvements and disable popt when unavailable (ie MINGW)