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)
 - use `install` instead of `cp -pf` where applicable

Possibly adding this as well:
 - [ ] Fix silent "make install" output (currently says INSTALL install, since $@ is target)