A workaround was to manually download the appropriated packages from http://tdm-gcc.tdragon.net/download in the folder X:\TDM-GCC-64\installer\downloaded and then run the tdm-gcc-5.1.0-3.exe installer.