ABS requires a speed sensor at each wheel, a computer, and a motor that controls brake fluid pressure. The computer senses when the brakes are applied and the speed of each wheel. If one wheel is going 0mph while the other wheel(s) are moving this indicates the wheel is skidding. The computer temporarily (several times a second) releases the brake fluid pressure to the wheel that is skidding.
So you would need a sensor at each wheel, a trigger for the sensor on the wheel, a computer, and a completely different automated brake pump. To build this yourself would cost more than buying a bike with ABS.