The syntax is:
cc main.m -lobjc -o prog1
If you intend to do more interesting things than subclass Object, you'll end up using the Cocoa framework:
cc main.m -framework Cocoa -o prog1
And, uh, I wouldn't recommend subclassing Object anywhere beyond this mickey mouse program, as it...