However, in general tar don't understand wildcards. There's a terribly ugly hack that you can use to select the files you want anyway. Try a command like this:
What you're doing here is using tar twice. tar t will print the names of all the files on the tape. The pattern supplied toselects the pathnames containg lib/foo or lib/bar, and the resulting filenames are passed to the first tar command, which actually extracts the files from the archive.