lots of build improvements

Signed-off-by: Ryan P.C. McQuen <ryan.q@linux.com>