Fix amazon linux dist

replaces #7408. Fixed to use ID. ping @tianon 
At this point, it might be worth adding `lsb_dist="$(echo "$lsb_dist" | lc)"` right before the `case` so these can actually look decent.

(Too bad this script can't just be Bash instead, so we could use something like `lsb_dist="${lsb_dist,,*}"`.)