Can a student with a weak or average undergraduate math GPA realistically become a professor?
You shouldn't give up hope yet, and you should follow your dream while having a backup plan or two in case things don't work out.  

Nothing that you've written rules out the possibility of your going on to graduate school, but it also isn't sufficient to ensure that you will be adequately prepared for admission to graduate study in mathematics.  What you do in the next few years will determine whether or not this is possible.  

There are many more steps beyond simply getting admitted to a graduate program and it's way too early to predict things will ultimately work out for you.  Take it one step at a time, and be prepared to reassess your goals in light of your future successes and failures.