Yes, and this is where some planning ahead of time is important.
On the green screen you need to place tracking markers, to give a 3D tracking software something to definitively latch onto.
Then, after you shoot, you import the footage into the 3D tracking software (PFTrack, Syntheyes, BouJou, etc), and do a 3D track of the greenscreen environment.
From this tracking data, you will export a comp for After Effects, with a 3D camera, and null objects that represent the green screen background.
You then drop your foreground footage into this comp (keeping it 2D), and the background you will make as a 3D layer, and use the null objects as a reference for placement. The After Effects camera will then match the production camera, and the background (in 3D space) will appear to move with the production camera.
If you did NOT have tracking marks on the green screen of the footage you have now, there *may* be enough contrast near the edges that you *might* be able to get a track. but ideally, you want to put trackers in *first*.