Reapplied lost liblightsql building and linking along with missing Makefile.am implementation
Fixed linking against curl library