Fix build.

- Removed deprecated attributes.
- Fixed libstd calls.
- Fixed some build errors.
- Fixed a small bug in Makefile