autogen.sh not working on Ubuntu on Windows
This means your file has DOS newlines thus, hidden CR characters at the end.
Thus, set -e becomes set -e$'\r' (using bash-specific syntax to represent the CR character), which isn't a valid option.

To fix this, if you have dos2unix installed, you can run:
    dos2unix autogen.sh