EDIT: When D9 is connected to XTAL2, I ran this command "avrdude -c avrispmkII -p m328p -P usb -B250" and also -B500 and it still failed to initialize.
avrdude: stk500v2_command(): command failedavrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00avrdude: initialization failed, rc=-1
To get an extra slow SCK you may need to use something else for programming.
It's making more sense to me now:- with 128kHz applied to XTAL2 you are getting 16KHz on CLKOUT- so you need to program it with SCLK not exceeding 4KHz- so -B 250 is barely enough cycle time, if avrdude does use the -B parameter to set the SCLK rate of the AVRISPmkIISo try with 128KHz applied to XTAL2 again, but this time:- try avrdude with a -B parameter greater than 250- try using AVR Studio, with the SCLK frequency in the user interface set to 4KHz or even lower.If that fails, try with 32768Hz or so applied to XTAL1 or XTAL2 (whatever gives you a clean CLKOUT signal) and use SCLK <= 1kHz in AVR Studio. The docs say you can't program the flash below 2KHz, but you can do a chip erase.