Got cmake working, and made some various makefile corrections to get the build to finish and link.