Makefile: Optimize build and linker

Based on JustArchi's optimizations.

Signed-off-by: Zhao Wei Liew <zhaoweiliew@gmail.com>