Detect correct lib dir location