added optional useLib to allow linking of runtime lib
cleanup