Fix global makefiles for the tests to support android
Two changes are required to compile the tests for android
- Disable the usage of -lpthread as it is included by default on android
- Add -pie to the linker flags because android only support position independent executables