build: Improve the beta numbering by autogen.sh
* autogen.sh: Introduce a 3rd matchstr and simplify rules.