improve the setup targets in the build script

* better detection of Debian/Ubuntu and derived distributions
* building on 32-bit distributions is supported (for i386 targets)
* introduce separate target to setup the MinGW-w64 toolchain