Update Makefile & Fix compile warnings

The Makefile is really mess up, need more work.
Source code still exist some compile warnings.
Merge pull request #1 from godspeed1989/master

Makefile update & warning fix