Update Makefile & Fix compile warnings

The Makefile is really mess up, need more work.
Source code still exist some compile warnings.