Fixes many C++ syntax/semantic errors and adds linux build script