and evidently, the Pro Mini bootloader doesn't handle the wdt correctly. See https://forum.arduino.cc/t/atmega328-locks-up-on-watchdog-reset/921269 . Some people say you can fix this by putting an Arduino Uno b
The whole source is 1.4G, of which you’ll only need 16M, so you may just want to use the sources installed by the IDE. On Ubuntu, see /usr/share/arduino. I recommend making a copy as you’ll need to make some changes. Change to the ./hardware/arduino/bootloaders/optiboot directory...