Penicillin is the most used remedy for syphilis, except in those people who have any kind of allergy to this antibiotic. They wouldn't have given them to you if they were not useful. Follow their instructions closely, and go periodically to talk to them as they may want to test you again to see how the infection is oing on.
All the best.