Fix build errors for linux.
Update makefiles.