added some headers missing from final include in makefile.am and related fixes after lock was added - still untested - only fixes compile-time errors