shared-lib: cleanup makefiles; make library init and finalize routines static