Update Makefile with several improvements Upstream-commit: 8aa3dc681dcc1fbbfcb71ba52661f551004d1b51 Component: engine