moving linux detection before gnu for tizen, because we can get linux-gnu string and linux is probably more likely than tizen.
adding -fPIC for linux. needed in case we want to build .so