BUILD: fixes and improvements to kernel building

Signed-off-by: Lens-F <tnoah12@gmail.com>