add a portable way to get lib directory