In wireless multi-hop networks, the allocation of resources is influenced by mechanisms for medium access control (MAC), routing, congestion control, and flow control. Designing these mechanisms jointly can increase the capacity of wireless networks. We attempt to introduce routing into an existing framework for the joint design of flow control and MAC on random access multi-hop wireless networks. The problem of joint flow control, routing and MAC in random access multi-hop wireless network is formulated as an optimization problem. However, a direct formulation yields a non-convex optimization problem. To overcome the difficulty in solving a non-convex problem, we introduce a harmonic rate function to convexify the formulation. The joint optimization mechanism is presented as an iterative process to compute a solution. The resultant distributed algorithm is proved to yield a global optimal solution when it converges. Numerical results are provided to show the convergence of the proposed algorithm and properties of the harmonic rate function.