Linux makefile and fixes for standalone project

Cloned from development branch and tested on Ubuntu 12.04