Improve configure check for log2