I just tried it on my Mega and avrdude didn't sync (feel free to fix this )
I've fixed this, change the part between double ##### lines to this
##########################################################
##########################################################
# Select processor line here
MCU = atmega328p
#MCU = atmega2560
ifeq ($(MCU),atmega2560)
UPLOAD_RATE = 115200
AVRDUDE_PROGRAMMER = stk500v2
COM = 39
endif
ifeq ($(MCU),atmega328p)
UPLOAD_RATE = 57600
AVRDUDE_PROGRAMMER = stk500v1
COM = 33
endif
ARDUINO_VERSION = 21
PROJECT_NAME = quubmon_client
PROJECT_DIR = d:/work/quubmon/client
ARDUINO_DIR = c:/progra~1/arduino/arduino-00$(ARDUINO_VERSION)
ARDUINO_CORE = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
ARDUINO_AVR = $(ARDUINO_DIR)/hardware/tools/avr/avr/include/avr
ARDUINO_LIB = $(ARDUINO_DIR)/libraries
AVRDUDE_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin
AVRDUDECONFIG_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc
AVR_TOOLS_PATH = c:/progra~1/atmel/bin
AVR_INC_PATH = c:/progra~1/atmel/avr/include/avr
PORT = //./COM$(COM)
F_CPU = 16000000
##########################################################
##########################################################
I've got different COMs because I'm working on two different boards at the same time.
Rob