updated build system to support building binaries both for target and host system (a bit hacky though)
corrected several errors in linker and startup code, also cleaned up build flags that were unused