Fast solution:
If you have x264, don't worry about un-install. Stay with it.
Check your assembler yasm verison.
Install gpac --> from svn.code.sf.net and compile it.
Copy gpac/inlucde/gapc/ into x264
inside x264 and configure as follow
./configure --extra-ldflags=-L/home/../gpac/bin/gcc --enable-mp4 --enable-shared --enable-debug --enable-PIC
You get the list in the configure x264 and you can easily find that your MP4 from 'no' changed to 'gpac'
Enter
make
Enter
make install
Write x264 command as
x264 big_buck_bunny.y4m -o big_buck_bunny.mp4
to test it. Now you have mp4 video. In this process it's not necessary to convert raw video to h264 and then in a second step with another tool to mp4.