You said in a post it was an internal computer speaker, I'm not sure why anyone is suggesting you connect it to an audio out header as those headers are for headphones and proper speakers. If you just want this to be an internal PC speaker (it would sound stuff as anything else), you need to find the 2 pin internal speaker header and solder on a connection similar to this:

In all honesty it's probably not worth your time. You can pick up these internal speakers that just beep for pennies on eBay.
Edit: just reread some stuff, looks like they are meant to be proper speakers. In that case, ditch them and get better speakers, they'll sound awful.