add cmake output files to gitignore
undefined site_t, add cstdlib
add guards so NULL is not redefined
fix a few errors