It is pretty easy to get the Makefile setup so it finds all the right files: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1238537083/1
The Makefile will have to be tweaked for any additional libraries you want to link with, and you will have to build any extra libraries yourself with a separate target. But for the basic "flash the LED" example it should just work. You may have had to have run the IDE once to get the core libs built...?
If this is really abut the MCU type, then it sounds like a simple problem: avrdude is finding a config file that does not have the right entry. You want to make sure you use the -C option passed to avrdude. Then, you make sure that this avrdude.conf file you pass in actualy has a reference section for the ath ATMega328p.
Finally, avrdude tries to guess what you mean when you pass in an MCU it does not understand. You really want the correct ID, which in this case is "m328p." avrdude will use a case-insensitive search on the description it finds in the avrdude.conf it knows about. So we don't want to let avrdude just find the default avrdude.conf -- we want to specify the exact location. Check that you don't have a local avrdude.conf in your home directory, either. Both of these might be outdated with respect to the recent upgrade to the 328.
So, make sure that avrdude is passed the correct avrdude.conf -- one that has been updated for the ATMega328 Arduinos -- and that has an ID of "m328p" with a description of "ATMEGA328P".
Sort this out first before trying to figure out anything else. Satisfy yourself that the command is being run correctly, and that the command is using the data that it needs to talk to the newer Arduinos.