[kernel] refactor Makefile