Short answer: with negative $b_i$'s, it's NP-hard, but otherwise it's polynomial time.

If you allow negative $b_i$ then it is hard (set all the $a_i=1$, so the goal is to get the chosen subset of $b_i$'s to sum to a number close to but greater than $-1$ in order to make the denominator as small as possible — this is a subset sum problem.

If the $a_i$'s and $b_i$'s are all positive, you have a bicriterion matroid optimization problem (the condition that $\sum x_i\le M$ is matroidal, and by bicriterion I mean taking a nonlinear combination of two linear functions). It is known that (under mild conditions on the nonlinear combination that hold for positive $b_i$ but not negative ones) such problems can be solved in polynomial time by parametric techniques
(replace the objective function $\sum a_i/(1+\sum b_i)$ by the parametric function $\sum a_i+\lambda(1+\sum b_i)$, then vary $\lambda$ from $-\infty$ to $+\infty$ and keep track of the sequence of maximum weight bases you get — one of them will be the optimal value for the original objective function).

For more on parametric matroid optimization see my paper

Geometric lower bounds for parametric matroid optimization.
D. Eppstein.
Tech. Rep. 95-11, ICS, UCI, 1995.
27th ACM Symp. Theory of Computing, Las Vegas, 1995, pp. 662–671.
Disc. Comp. Geom. 20: 463–476, 1998.
http://www.ics.uci.edu/~eppstein/pubs/Epp-DCG-98.pdf

For more on the relation between parametric and bicriterion optimization (mostly not about matroids but with the same general principle) you can see another of my papers, more recent (although this connection is far from original to me):

The parametric closure problem.
D. Eppstein.
14th Algorithms and Data Structures Symp. (WADS 2015), Victoria, BC.
Springer, Lecture Notes in Comp. Sci. 9214 (2015), pp. 327–338.
http://arxiv.org/abs/1504.04073

The particular matroid involved in your question (a uniform matroid), when turned into a parametric optimization problem, has $O(n^{4/3})$ different changes of basis and they can be found in time proportional to that bound — see https://en.wikipedia.org/wiki/K-set_(geometry) for an equivalent problem in computational geometry.