If $\pi_v$ is supercuspidal, then (after making a twist if necessary) it should be possible to find an automorphic $\pi$ with $\pi_v$ as the local factor at $v$. This kind of result is usually proved (although their are sometimes other possibilities) by an application of the simple trace formula. This method will also give good (although perhaps not complete) control of the ramification at other places. If you look at the paperspaper of Deligne, Kazhdan, and Vigneras (and others?) on on Jacquet--Langlands for $GL_n$, I think you will find an expose of the technique.
If $\pi_v$ is not supercuspidal (or if one is not willing to make a twist), then this is not generally possible, just for cardinality reasons. The link that David Loeffler provides to the discussion of the $GL_2$ case is somewhat indicative of the situation.