Fix compile warnings and linker error

Fix a few compiler warnings that showed up on RHEL 7, although they
may have been present in the past.

Fix a linker error. Passing the -static switch to cc seems to stop it
finding /usr/lib64/libutil.so.