Correctly detect Amazon Linux

Resolves issue #3121.