Build improvements

Here's a couple of minor changes to the build system. Besides spaces, tabs and nits it provides two benefits:
 - Avoid build warnings (-pthread, -rdynamic)
 - Pass CC to Lua build (CC=clang would still invoke gcc for lua)

I also wanted to switch `cp -pf` with `install`, but its behaviour is different on Illumos.

A couple of optional todo's:

 - [ ] Symlink sentinel instead of copying it and install the symlink
 - [ ] Fix silent "make install" output (currently says INSTALL install, since $1 is the command and not what file to be installed)