Похоже, вы пропустили часть инструкций. В Ubuntu 16.04 вам нужно запустить:
sudo apt install software-properties-common
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu zesty universe"
sudo apt update
sudo apt upgrade
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
В Ubuntu 17.10+:
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
Заведомо медленный ввод-вывод, потому что он основан на событиях -. Кажется более вероятным, что узким местом здесь является фактическое устройство, а не ваше ядро.