Makefile: Apply some optimizations

Based on JustArchi's optimizations.

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