get rid of pstrdup warning and fix rpath flag