Fix compilation bugs, syntax, add readme, license.

Fix global makefile. Fix compilation bugs of certain files. Add README
and LICENSE files.