A Numerical method to compute the running coupling in asymptotically free theories