linux: Fix Linux hosted build

A bunch of cleanups and fixes necessary for Linux version to work.