Connect the STK500 in high voltage programming mode. http://www.atmel.com/webdoc/stk500/stk500.PHVProgramming.html http://www.atmel.com/webdoc/stk500/stk500.highVoltageProgramming.html
Use avrdude
to write the fuse. Change /dev/ttyUSB0
to the actual serial port.
avrdude -p ATMega644p -c stk500 -P /dev/ttyUSB0 -v -U lfuse:w:0xcf:m -U hfuse:w:0xd1:m -U efuse:w:0xff:m
It should say
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: safemode: hfuse reads as D1
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:D1, L:CF)