Fix compile and linker flag issues. Also clean up covscan issues. Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>