Fix undefined reference caused by wrong detection of gcc builtin atomic functions.