Rearanged the flash makefile to prevent it from bulding the whole project each time. Also fixed some bugs.