I believe it is legal to occasionally build your own gun from scratch, for your own personal use. But I'd check with the ATF first.
I'd love to try it if I had free access to a good machine shop, and a lot of time to learn.
I'd also start with .22LR, not .50BMG, and work my way up, to avoid getting my head blown off if I screw up.