Fix linux build issues

I had a few problems building nscp on my machine running ubuntu 12.04. After applying the attached patches it builds for me successfully.