Fix detection of cross compilation