Changed runtests.sh to run against separate build dir
Fix few build issues: rpath, missing PIC flag, etc