fixed serial communication bugs. changed makefile and separated flash/debug operation.