fix ORIGIN issues, remove unused lib defs