Refactoring build system

Now build is recursive and kernel compilation is bit more separated from
other targets possibly added in the future.
Added previously missing header file