Makefile: update to work with Linaro 4.9.1 toolchain
And fixed some compilation errors.

Signed-off-by: Pafcholini <pafcholini@gmail.com>